<?php

namespace app\model;

use think\Model;


class Withdraw extends Model
{
    protected $pk = 'id';

    public function getStatusAttr($value)
    {
        $status = [
            0 => '申请中',
            1 => '审核通过',
            2 => '确认',
            3 => '驳回',
        ];
        return $status[$value];
    }

    public function getTypeAttr($value)
    {
        $status = [
            0 => '',
            1 => '本金',
            2 => '佣金',
        ];
        return $status[$value];
    }


    public static function getWithdraw($mp){
        return static::where($mp)->order('addtime', 'desc')->select();
    }

}